import type {SysFileForm} from "@/api/sysFile/model";
import SysFileAPI from "@/api/sysFile/index";
import type { IModalConfig } from "@/components/PageModal/index.vue";

const modalConfig: IModalConfig<SysFileForm> = {
  pageName: "sysFile",
  pk: "id",
  component: "drawer",
  drawer: {
    title: "修改文件图片上传管理",
    size: '50%',
  },
  formAction: function (data) {
    return SysFileAPI.edit(data);
  },
  beforeSubmit(data) {
    //提交之前处理
  },
  formItems: [
    {
        label: "文件名称",
        prop: "fileName",
        type: "input",
        attrs: {
            placeholder: "请输入文件名称",
        },
    },
    {
        label: "文件路径",
        prop: "filePath",
        type: "input",
        attrs: {
            placeholder: "请输入文件路径",
        },
    },
    {
        label: "文件大小(字节)",
        prop: "fileSize",
        type: "input",
        attrs: {
            placeholder: "请输入文件大小(字节)",
        },
    },
    {
        label: "上传者",
        prop: "uploadUserName",
        type: "input",
        attrs: {
            placeholder: "请输入上传者",
        },
    },
    {
        label: "上传者id",
        prop: "uploadUser",
        type: "input",
        attrs: {
            placeholder: "请输入上传者id",
        },
    },
  ],
};

export default modalConfig;
